#ifndef __CAM_H__
#define __CAM_H__
#include "ti_msp_dl_config.h"
#include "string.h"
#include "buzzer.h"
#include "PID.h"
#include "servo.h"
#define CAM_X_WIDE 640
typedef struct
{
    float delta_x;
    float delta_y;
    float PID_buff[3][3];
    uint8_t data_is_fresh;
} cam_data_struct;

extern cam_data_struct cam_data;
extern uint16_t x;
extern uint16_t y; // x和y坐标
extern uint16_t blob_area; // 色块面积
extern uint8_t is_findblob; // 是否找到色块
extern uint8_t yolo_flag; // 是否使用YOLO检测数字
extern uint8_t hash_table[10]; // 数字哈希表
extern uint8_t Cam_DMA_Buffer[20]; // DMA接收数据缓冲区
float adaptive_PID(uint16_t blob_area, float cal_out); // 自适应PID函数
void cal_cam_receive_data(uint8_t *data_buffer);
void cam_proc(void);
void cam_init(void);

#endif